<template>
	<view >
		<template v-if="!loading">
				<view v-for="item in data" :key="item.id" class="contentItem viewWidth" @click="jump(item)">
					<view  @click.stop="()=>{}">
						<image mode="aspectFill" :src="item.thumb" />
					</view>
					<view class="contentInfo">
						<view>
							{{item.title}}
						</view>
						<view>
							<view class="icon">
								{{item.is_public?'公开':'个人'}}
							</view>
							<view class="icon">
								{{item.is_hide?'隐藏':'显示'}}
							</view>
						</view>
						<view>
							开始时间:{{item.start_at}}
						</view>
					</view>
				</view>
		</template>
		<template v-else>
			<view v-for="item in 8" :key="item" class="contentItem viewWidth">
				<view class="Skeleton" style="width: 160rpx;height: 160rpx;" />
				<view class="contentInfo">
					<view style="height: 30rpx;width: 100%;" class="Skeleton" v-for="item in 3" :key="item" />
				</view>
			</view>
		</template>
	</view>
</template>

<script>
	export default {
		props:['data','loading'],
		data() {
			return {
			}
		},
		methods: {
			jump(item) {
				if (!item.has_started) {
					this.$utils.navigateTo({
						url: "/Conquer/detailNoStar?id=" + item.id
					})
				} else if (item.is_public) {
					this.$utils.navigateTo({
						url: "/Conquer/Detail?id=" + item.id
					})
				} else {
					this.$utils.navigateTo({
						url: "/User/detail?conquer_id=" + item.id + '&id=' + item.user_id
					})
				}
			},
		}
	}
</script>

<style lang="scss" scoped>


	.contentItem {
		padding: 20rpx 0;
		display: flex;
		border-bottom: 1rpx solid #f5f5f5;

		image {
			width: 160rpx;
			height: 160rpx;
			border-radius: 8rpx;
		}


		.contentInfo {
			flex: 1;
			margin: 0 20rpx;
			display: flex;
			flex-direction: column;
			height: 160rpx;
			justify-content: space-between;
		}
.icon {
			background-color: #ddd;
			border-radius: 100rpx;
			padding: 8rpx 20rpx;
			display: inline-block;
			margin-right: 10rpx;
		}
	}
</style>